<template>
	<view class="pageAll">
		<view>
			<view class="pageFile" :style="userType === 1?'width:auto':''">
				<view class="pageFileTip" :class="userType === 1?'pageFileTipUser':'pageFileTipCom'">
					{{userType === 1?tipMessage.user:tipMessage.company}}
				</view>
				<view class="crossView" :class="userType === 2?'crossViewCenter':''">
					<updataFile v-if="userType === 1 || userType ===2" :num="userType === 2?1:2"  :cssClass="'crossDown'" v-on:getImageTempPaths="getImageTempPaths" :alreadyUpdata="alreadyUpdata" :imgType="1" :type="2" :tipText="userType ===1 ?'点击上传红标买手合同':'点击上传红标供应商合同'"/>
					<updataFile v-if="userType === 1" :cssClass="'crossDown'" :num="userType === 2?1:2" v-on:getImageTempPaths="getImageTempPaths" :alreadyUpdata="alreadyUpdata" :imgType="2" :type="2" :tipText="'点击上传红标个人供应商合同'"/>
				</view>
			</view>
			<view class="pageBottomTip">
				<view class="pageBottomTipInfo" v-for="(item, index) in tipMessageBottom" :key="index">
					<text>{{item}}</text>
				</view>
				<view class="pageBottomBtn">
					<button @click="nextStep" hover-class="subActive">
						下一步
					</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import updataFile from '../../../components/commonCom/updataFile.vue'
	export default {
		data() {
			return {
				tipMessage: {
					user: '请上传《红标买手合同》或《红标个人供应商合同》',
					company: '请上传《红标供应商合同》',
				},
				file: [{
						fileName: '红标供应商合同',
						fileSize: '2233kb'
					},
					{
						fileName: '红标供应商合同红标供应商合同红标供应商合同红标供应商合同',
						fileSize: '223322332233kb'
					},
				],
				tipMessageBottom: [
					'如有合作疑问，请联系我们',
					' 客服电话：15927185402 ',
					'收件地址：深圳市南山区华侨城华夏艺术中心三层',
				],
				userType: 1, // 1 为买手或供应商
				updateType: null, // 上传的文件类别 1为买手合同， 2为供应商合同
				alreadyUpdata: false,
			}
		},
		methods: {
			// 下一步
			nextStep() {
				if(this.userType === 1) {
					uni.redirectTo({
						url:'../ImprovePerInfo/ImprovePerInfo?userType=' + this.userType
					})
				} else {
					uni.redirectTo({
						url:'../ImproveCorInfo/ImproveCorInfo?userType=' + this.userType
					})
				}
				
			},
			// 获取图片路径, 由子组件将数据传递过来
			getImageTempPaths(childValue) {
				this.updateType = childValue.type
				this.alreadyUpdata = true
			},
		},
		components: {
			updataFile, // 选择图片
		},
		onLoad(option) {
			this.userType = parseInt(option.userType)
			
		}
	}
</script>

<style scoped>
	.pageAll {
		box-sizing: border-box;
		background-color: #c1504a;
		width: 100%;
		height: 100%;
		display: inline-block;
		padding: 0 17upx 0 17upx;
	}

	.pageFile {
		width: 500upx;
		height: auto;
		margin: 320upx auto 0 auto;
		background-color: #fff7f5;
		padding: 42upx;
		border-radius: 20upx;
		box-shadow: 0 0 26.66upx 3.33upx #d75e2e;
	}

	.pageFileTip {
		padding-bottom: 30upx;
		color: #333333;
	}
	.pageFileTipUser{
		font-size: 26.66upx;
	}
	.pageFileTipCom{
		font-size: 36upx;
		font-weight: bold;
	}
	
	.crossView{
		display: flex;
		flex-wrap: nowrap;
		justify-content : space-between;
		margin: 30upx 0;
	}
	.crossViewCenter{
		justify-content : center !important;
	}

	.pageFile .file {
		padding: 30upx 0;
		border-bottom: 1px solid #e8dddb;
	}

	.pageFile .file:last-child {
		border-bottom: none;
		padding-bottom: 0 !important;
	}

	.pageBottomTip {
		margin-top: 35upx;
	}

	.pageBottomTipInfo {
		text-align: center;
		font-size: 24upx;
		color: #FFF;
		margin-bottom: 15upx;
	}

	.pageBottomBtn {
		margin-top: 35upx;
	}
	.pageBottomBtn button{
		width:242upx;
		height:70.66upx;
		background-color: #f7533e;
		line-height: 70.66upx;
		color:#FFF;
		letter-spacing: 20upx;
		box-shadow: 0 0 50upx -13upx #565656;
		padding: 0;
	}
	.subActive{
		background-color: #FFC8C7 !important;
	}
</style>
